import { lazy } from "react";

export let mainRouter = [
    {
        path:"/index/home",
        element:lazy(()=>import("../page/Index/Home")),
        title:"首页"
    },
    {
        title:"应用管理",
        path:"/index/app",
        element:lazy(()=>import("../page/Index/application/App")),
        children:[
            {
                path:"/index/app/my_application",
                element:lazy(()=>import("../page/Index/application/My_application")),
                title:"我的应用",
                exat:"1"
            },{
                path:"/index/app/recycle",
                element:lazy(()=>import("../page/Index/application/Recycle")),
                title:"回收站",
                exat:"1"
            },
        ]
    },
    {
        title:"工单",   
        path:"/index/repair",
        element:lazy(()=>import("../page/Index/repairOrder/Repair")),
        children:[
            {
                path:"/index/repair/create_worker",
                element:lazy(()=>import("../page/Index/repairOrder/Create_workers")),
                title:"创建工单",
                exat:"2"
            },   
            {
                path:"/index/repair/worker_list",
                element:lazy(()=>import("../page/Index/repairOrder/Workers")),
                title:"工单列表",
                exat:"2"
            },
        ]
    },
    {
        title:"消息",
        path:"/index/message",
        element:lazy(()=>import("../page/Index/message/Message")),
        children:[
            {
                path:"/index/message/inbox",
                element:lazy(()=>import("../page/Index/message/Inbox")),
                title:"收件箱",
                exat:"3"
            }, 
            {
                path:"/index/message/message_manage",
                element:lazy(()=>import("../page/Index/message/Message_management")),
                title:"消息管理",
                exat:"3"
            }
        ]
    }
]

const routes = [
    {
        from:"/",
        to:"/index/home"
    },
    {
        path:"/index",
        element:lazy(()=>import("../page/Index")),
        children:mainRouter
    },
    {
        path:"/login",
        element:lazy(()=>import("../page/Login"))
    },
    {
        path:"/no_permissions",
        element:lazy(()=>import("../page/NO_permissions"))
    },
    {
        path:"*",
        element:lazy(()=>import("../page/Eorry404"))
    }
]

export default routes